import { defineStore } from "pinia";

/**
 * app 全局
 */
const useAppStore = defineStore("test", {
  state: () => ({
    name: "易烊千玺",
    man: {
      age: 11,
    },
    habit: [11, 22, 33],
  }),
  actions: {
    /**
     * 获取全局配置
     */
    changeName(name) {
      this.name = name;
    },
    changeManAge(age) {
      this.man.age = age;
    },
    changeArr(item) {
      this.habit.push(item);
    },
  },
});

export default useAppStore;
